package com.token.model.dto;

import com.token.service.Function;

/**
 * @auther: henriy
 * @Date: 2023/12/29
 */
public class FunctionTest {

    private final Function<String, Integer> function;

    public FunctionTest(Function<String, Integer> function){
        this.function = function;
    }

    public Integer testStr(String str){
        return function.apply(str);
    }

    public static void main(String[] args) {
        FunctionTest functionTest = new FunctionTest(String::length);
        Integer test = functionTest.testStr("test");
        System.out.println(test);
    }


}
